package com.example.refi;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@SpringBootApplication
public class RefiApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(RefiApplication.class, args);
    }
    // 配置跨域的代码在这里
    @Bean
    public WebMvcConfigurer webMvcConfigurer() {
        return new NetWorkConfig();
    }

    @Override//为了打包springboot项目
    protected SpringApplicationBuilder configure(
            SpringApplicationBuilder builder) {
        return builder.sources(this.getClass());
    }
}
